package com.springboot.controller;

import com.springboot.entity.*;
import com.springboot.service.IHisInsuranceService;
import com.springboot.util.OutParmUtil;
import com.springboot.util.paramJx;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.springboot.service.IHisLisEmrService;

@RestController
@Slf4j
public class HisLisEmrController {
	
	@Autowired
	private IHisInsuranceService hisInsuranceService;



	
	@RequestMapping("msgTransferBody")
	public OutParm msgTransferBody(@RequestBody String msg){

		try{
			Object object = paramJx.MyParamJx(msg);

			if(object.getClass().equals(Zthc.class)){
				Zthc zthc = (Zthc) object;
				return this.hisInsuranceService.ztinvoke(IHisLisEmrService.class,zthc.getMethod(),zthc);
			}else{
				TbRisReport tbRisReport = (TbRisReport) object;
				return this.hisInsuranceService.tbinvoke(IHisLisEmrService.class,tbRisReport.getMethod(),tbRisReport);
			}
		}catch (Exception e){
			e.printStackTrace();
			return OutParmUtil.fail("系统错误");
		}





	}





}
